﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
using System.Data;


namespace DAL.BusinessDeal
{
    public class StDangerousCargoCodesDAL
    {
        public const string ST_DANGEROUS_CARGO_CODES =
    @"select  DTP_DNGGCD,DTP_DNGGNM from st_dangerous_cargo_codes";

        /// <summary>
        /// 获取船期
        /// </summary>
        /// <returns></returns>
        public DataTable GetTable()
        {
            return GetDataTable(ST_DANGEROUS_CARGO_CODES);
        }

        public DataTable GetDataTable(string sql)
        {
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(sql);
            DataTable dt = db.ExecuteDataTable(dbCommand);
            if (dt != null)
            {
                dt.TableName = "st_dangerous_cargo_codes";
            }
            return dt;
        }
    }
}
